﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/BackSite.Master" Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
     添加部门 
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="TablePlaceHolder" runat="server">

    <h2>addDepartment</h2>

</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="TitlePlaceHolder" runat="server">
    <p style="background-image: url('../../Content/images/toolbar_bg.gif'); background-repeat: repeat-x">
        <span class="font16 fLeft" style="font-size: 26px"><strong>添加部门</strong></span><span class="fRight mR10 mT08"></span>
    </p>
</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <style type="text/css">
        .error {
            color: red;
        }
    </style>

    <script type="text/javascript">
        $(document).ready(function () {
            var ma = $('#form1').validate();

            jQuery.extend(jQuery.validator.messages, {
                required: "必填项",
                remote: "Please fix this field.",
                email: "邮箱格式不正确,请确认",
                url: "URL地址格式错误，请确认",
                date: "日期格式错误，请确认",
                dateISO: "日期格式(ISO)错误，请确认.",
                number: "请输入数字",
                digits: "请输入整数",
                creditcard: "信用卡号码格式错误",
                equalTo: "两次输入不一致",
                accept: "后缀名错误",
                mobile: "手机号码格式错误",
                tel: "电话号码格式错误",
                mobileOrTel: "手机或电话号码格式错误",
                qq: "QQ号码格式错误",
                chinese: "请输入中文",
                idcard: "身份证号码格式错误",
                letter: "请输入字母",
                ip: "IP地址格式错误",
                zipcode: "邮政编码格式错误",
                maxlength: $.validator.format("最多输入 {0} 个字符"),
                minlength: $.validator.format("最少输入 {0} 个字符"),
                rangelength: $.validator.format("字符长度介于 {0} 到 {1} 之间"),
                range: $.validator.format("值大小介于 {0} 到 {1}之间"),
                max: $.validator.format("最大值不超过 {0}"),
                min: $.validator.format("最小值不小于 {0}")
            });
            $("#btnSub").click(function () {
                var txtDepID = $("#txtDepID").val();
                var txtDepName = $("#txtDepName").val();
                var selectParentDepID = $('#selectParentDepID option:selected').val();
                $.ajax({
                    type: "POST",
                    url: "addDept",
                    data: "txtDepID=" + txtDepID + "&&txtDepName=" + txtDepName + "&&selectParentDepID=" + selectParentDepID,
                    success: function (sesponseTest) {
                        alert(sesponseTest);
                    }
                });
            });
        });
    </script>

    <table>
        <tr>
            <td style="width: 246px" class="x-btn-inner-right">部门编码：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </td>
            <td style="width: 243px">
                <input id="txtDepID" type="text" class="required" /></td>
        </tr>
        <tr>
            <td style="width: 246px" class="x-btn-inner-right">部门名称：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </td>
            <td style="width: 243px">
                <input id="txtDepName" type="text" class="required" /></td>
        </tr>
        <tr>
            <td style="width: 246px" class="x-btn-inner-right">上级部门编码：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </td>
            <td style="width: 243px">
                <select id="selectParentDepID" name="D1">
                    <option>CYDD001</option>
                    <option>CYDD002</option>
                    <option>CYDD003</option>
                    <option>CYDD004</option>
                    <option>CYDD005</option>
                </select></td>
        </tr>
        <tr>
            <td style="width: 246px" class="x-btn-inner-right">
                <input id="btnSub" type="button" value="提交" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </td>
            <td style="width: 243px">
                <input id="BtnCancel" type="button" value="取消" /></td>
        </tr>
    </table>

</asp:Content>

<asp:Content ID="Content5" ContentPlaceHolderID="TableHeadPlaceHolder" runat="server">
</asp:Content>
